<template>
  <div class="product-content">
          <div class="productBox">
                <div class="headerBox">
                      <div class="line"></div>
                      <div class="title">消毒产品</div>
                </div>

                <el-table :data="infoList" border>
                  <el-table-column label="序号" align="center" type="index" />
                  <el-table-column label="消毒产品名称" align="center" prop="productName" />
                  <el-table-column label="消毒产品厂家" align="center" prop="factory" />    
                  <el-table-column label="批号" align="center" prop="lotNumber" />   
                  <el-table-column label="采购日期" align="center" prop="purchaseTime" />   
                  <el-table-column label="操作" align="center" >
                        <template slot-scope="scope">
                                <el-button
                                size="mini"
                                type="text"
                                @click="handleTest(scope.row)"
                                >查看详情</el-button>
                        </template>
                    </el-table-column > 
                </el-table>
                    <pagination
                      v-show="total>0"
                      :total="total"
                      :page.sync="queryParams.pageNum"
                      :limit.sync="queryParams.pageSize"
                      @pagination="getDisinfectionProductFn"
                    />
                <div class="bottomBtnCss">
                  <el-button @click="goBackBtn">返回</el-button>
                </div>
          </div>
  </div>
</template>

<script>
  import { getDisinfectionProduct} from "@/api/zhangping/watherDrinking";
  export default {
    data() {
      return {
        infoList:[],
        queryParams: {  
          creditCode:'', 
          pageNum: 1,
          pageSize: 10, 
          },
         total:0
      };
    },
    created() {
        this.queryParams.creditCode = this.$route.query.creditCode
        this.getDisinfectionProductFn()
    },
    methods: {
      getDisinfectionProductFn(){
        getDisinfectionProduct(this.queryParams).then(res=>{
                if(res.code == 200){
                     this.infoList = res.rows
                     this.total = res.total
                }else{
                     this.$message.error(res.msg);  
                }    
           })
        },
      handleTest(item){
          this.$router.push(`/drinkWaterHygiene/test2/productDetail?id=${item.id}`)  
        },
        goBackBtn(){
          this.$router.back()
        },
    }
  };
</script>
<style lang="scss" scoped>
         .display-fx-center{
             display: flex;
             align-items: center;
         }
         .product-content{
              overflow-y: auto;
              position: relative;
              background-color: #fff;
              padding: 40px 20px;
              border-radius: 10px;
              height: calc( 100vh - 66px - 40px);
             .productBox{
                    padding-bottom:40px;

              }
           .headerBox{
                font-size: 16px;
                color: #484848;
                font-weight: bold;
                // margin-top:40px;/
                margin-bottom:15px;
                @extend .display-fx-center;
                .line{
                  width: 4px;
                  height: 12px;
                  background: #5D85FF;
                  border-radius: 6px 6px 6px 6px;
                  margin-right:6px;
                }
             }
             .header-search{
                   flex-wrap: wrap;
                   @extend .display-fx-center; 
                  .searchBox{
                    font-size: 14px;
                    color: #797C84;
                     margin-right:40px;
                      margin-bottom:15px; 
                      @extend .display-fx-center; 
                      .lable{
                           flex-shrink: 0;
                           margin-right:10px; 
                      } 
                      .search-btn{
                        padding: 8px 20px!important;
                      }
                  }
             }
          }
          .bottomBtnCss{
            // margin-top: auto;
            text-align: right;
            position: fixed;
            bottom: 40px;
            right: 40px; 
        }
        ::v-deep{  
           .el-table__header-wrapper th{
                 background: #F4F8FF!important;       
           }
        }
        
</style>
